﻿using AutoMapper;
using MyRabbit.Application.Command;
using MyRabbit.Application.Command.ImgCommand;
using MyRabbit.Application.Command.SlaughteCommand;
using MyRabbit.Application.Dtos;
using MyRabbit.Domain;

namespace MyRabbit.Web.Api
{
    public class MappingProfile:Profile
    {
        public MappingProfile()
        {
            //用户登录
            CreateMap<User,UserDTO>().ReverseMap();
            //用户添加
            CreateMap<User, UserAddCommand>().ReverseMap();
            //添加产品
            CreateMap<Product, ProductAddCommand>().ReverseMap();
            //删除产品
            CreateMap<Product,ProductDelCommand>().ReverseMap();
            //修改产品
            CreateMap<Product, ProductUpdateCommand>().ReverseMap();
            //添加养殖
            CreateMap<Breed, BreedAddCommand>().ReverseMap();
            //修改养殖
            CreateMap<Breed, BreedUpdateCommand>().ReverseMap();
            //显示养殖
            CreateMap<BreedDTO, Breed>().ReverseMap();
            //添加图片
            CreateMap<ImgInfo,ImgAddCommand>().ReverseMap();
            //删除图片
            CreateMap<ImgInfo, ImgDelCommand>().ReverseMap();
            //添加屠宰
            CreateMap<Slaughte, SlaughteAddCommand>().ReverseMap();
            //删除屠宰
            CreateMap<Slaughte, SlaughteUpdateCommand>().ReverseMap();


        }
    }
}
